package com.sunkingdom.qq.demo.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sunkingdom.qq.user.entity.User;
import com.sunkingdom.qq.user.service.UserService;

import java.util.List;

@Controller
@RequestMapping("/demo")
public class UserController {
	@Autowired
	private UserService userService;
	
	@RequestMapping("/users")
	public String selectUser(ModelMap model){
		List<User> users = userService.listUsers();
		model.put("test", "test");
		model.put("users", users);
		return "/demo/users";
	}
}
